package com.itheima.test;

import com.itheima.domain.User;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.apache.ibatis.io.Resources;


public class 增加数据 {
    public static void main(String[] args)throws Exception {
        SqlSession sqlSession = new SqlSessionFactoryBuilder().build(Resources.getResourceAsStream("mybatis-conﬁg.xml")).openSession(true);

        User user = new User();
        user.setName("李某某");
        user.setPassword("123456");
        user.setBirthday("1995-07-27");
        user.setEmail("619813221@qq.com");

        int count = sqlSession.insert("UserMapper.insert",user);
        System.out.println("共"+count+"行受到影响");

        sqlSession.close();
    }
}
